package cn.com.cym.gamezao.entity.grk;

import cn.com.cym.gamezao.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;

@Getter
@Setter
@NoArgsConstructor
@Entity
@Accessors(chain = true)
@Table(name ="sample_cure")
@ApiModel(description = "治疗方案")
public class Cure extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -2417381271995160979L;

    @ManyToOne
    @JoinColumn(name = "patient_id")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Patient patient;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "cureTime",value = "治疗时间",dataType = "LocalDateTime")
    private LocalDate cureTime;

    /**
     * 用药
     */
    @Column(length = 126)
    private String medicine;


    /**
     * 备注
     */
    @Column(length = 500)
    private String memo;
}
